'Binary storage consists of a sequence of Object IDs
Object IDs are identified by 4 byte words.
First byte defines type:
byte between: 128 and: 255
small integer in 31 bits
byte = 0 object id in next 3 bytes
byte = 1 nil
byte = 2 true
byte = 3 false
byte = 4 object id in next 3 bytes; object definition follows
byte = 5 class id in next 3 bytes; class definition follows
byte = 6 global id in next 3 bytes; global definition follows
Object Definitions are
class id
followed by
non-indexable
inst size in next byte
''inst size'' ids follow
indexable
inst size in next byte
variable size in next 3 bytes
''inst size'' ids follow
''variable size'' elements follow
see implementors of storeBinaryDefinitionOn:manager: & readBinaryContentsFrom:manager:
Class Definitions are
format in next 2 bytes
name length in next 2 bytes
name length bytes of name
Global Definitions are
expression length in next two bytes
''expression'' characters follow
The objects stored as global definitions are collected during BinaryOutputManager>>initialize using the addGlobalsTo:manager: message. It is possible (hopefully easily) to customize this to add your own globals to the set.'!